<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:f="http://java.sun.com/jsf/core"      
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:p="http://primefaces.org/ui"
    template="/templates/layout.xhtml">
   	
	<ui:param name="issuesPage" value="true" />
	<ui:define name="content">
	<h:outputStylesheet name="css/main.css" />
		
	<h:form id="form">

	<p:growl id="growl" sticky="true" showDetail="true" showSummary="true" autoUpdate="true"  />

	<h:panelGrid columns="3"   styleClass="top-control-panels" columnClasses="top-left-panel panel, top-center-panel panel, top-right-panel panel">
		<p:column >	
			<p:outputLabel value="Project:"/><br />
			<p:selectOneMenu id="project" value="#{reportBean.project_name}" styleClass="item" >
				<f:selectItem itemLabel="Please select a project... " noSelectionOption="true" />
   				<f:selectItems var="project" value="#{reportBean.projects}" itemValue="#{project.name}" itemLabel="#{project.name} " />
   				<f:ajax listener="#{reportBean.changeProject}" render="issue status assignees time mainButtonsPanel" /> 
			</p:selectOneMenu>	
			<br />
			<p:outputLabel value="Members:"/><br />
			<p:selectCheckboxMenu id="assignees" value="#{reportBean.assignees_name}" label="Members" disabled="#{reportBean.disableMenu}" filter="true" filterMatchMode="startsWith" styleClass="item" >
        		<f:selectItems var="assignee" value="#{reportBean.assignees}" itemValue="#{assignee.name} " itemLabel="#{assignee.name} " />
        	</p:selectCheckboxMenu>	
		</p:column>
			
		<p:column>
			<p:outputLabel value="Type:"/><br />
			<p:selectCheckboxMenu id="issue"  value="#{reportBean.issueType}" disabled="#{reportBean.disableMenu}" styleClass="item">
				<!-- <f:selectItem itemLabel="All " noSelectionOption="true" /> -->
   				<f:selectItem itemValue="Bug" itemLabel="Bug" />
   				<f:selectItem itemValue="Improvement" itemLabel="Improvement" />
   				<f:selectItem itemValue="New feature" itemLabel="New feature" />
   				<f:selectItem itemValue="Task" itemLabel="Task" />
				<f:ajax listener="#{reportBean.changeIssue}" />
			</p:selectCheckboxMenu>
			
			<br />
			<p:outputLabel value="Status:"/><br />
			<p:selectCheckboxMenu id="status"  value="#{reportBean.status}"  disabled="#{reportBean.disableMenu}" styleClass="item">
				<!-- <f:selectItem itemLabel="All " noSelectionOption="true" /> -->
				<f:selectItem itemValue="Closed" itemLabel="Closed" />
				<f:selectItem itemValue="In progress" itemLabel="In progress" />
				<f:selectItem itemValue="Open" itemLabel="Open" />
				<!-- <f:selectItem itemValue="Reopened" itemLabel="Reopened" /> -->
				<f:selectItem itemValue="Resolved" itemLabel="Resolved" />
			</p:selectCheckboxMenu>	
			
		</p:column>
		
		<p:column>
			<p:outputLabel value="Time:"/><br />
			
			<p:outputPanel>
				<p:selectOneRadio value="#{reportBean.timespent}" id="time"  layout="pageDirection" disabled="#{reportBean.disableMenu}" styleClass="radio" >
   						<f:selectItem itemValue="allTime" style="margin-bottom:10px;" itemLabel="" /> 
   						<f:selectItem itemValue="date" itemLabel="" />
   						<f:ajax listener="#{reportBean.changeTime}" render="issue allTime dateFrom dateTo" />
				</p:selectOneRadio>
				   
				 <p:selectOneMenu id="allTime" value="#{reportBean.predefinedDate}" disabled="#{reportBean.disableSelectTime} or #{reportBean.disableMenu}"  styleClass="predefineddate">
   					<f:selectItem itemValue="All Time" itemLabel="All Time" noSelectionOption="true" />
   					<f:selectItem itemValue="Today" itemLabel="Today" noSelectionOption="true" />
   					<f:selectItem itemValue="Yesterday" itemLabel="Yesterday" noSelectionOption="true" />
   					<f:selectItem itemValue="This week" itemLabel="This week" noSelectionOption="true" />
   					<f:selectItem itemValue="Last week" itemLabel="Last week" noSelectionOption="true" />
   					<f:selectItem itemValue="Last seven days" itemLabel="Last seven days" noSelectionOption="true" />
   					<f:selectItem itemValue="Last four weeks" itemLabel="Last four weeks" noSelectionOption="true" />
   					<f:selectItem itemValue="This month" itemLabel="This month" noSelectionOption="true" />
   					<f:selectItem itemValue="Last month" itemLabel="Last month" noSelectionOption="true" />
   					<f:selectItem itemValue="Last thirty days" itemLabel="Last thirty days" noSelectionOption="true" />
   					<f:selectItem itemValue="This year" itemLabel="This year" noSelectionOption="true" />
				</p:selectOneMenu>
				<br />
				<div class="calendar-box">
					<p:outputLabel value="From: "/>
       				<p:calendar id="dateFrom" size="4" value="#{reportBean.dateFrom}" disabled="#{reportBean.disableSelectDate}" styleClass="calendar-item"/>
					<p:outputLabel value=" To: "/>
       			 	<p:calendar id="dateTo" size="4"  value="#{reportBean.dateTo}" disabled="#{reportBean.disableSelectDate}" styleClass="calendar-item"/> 
				</div>
			</p:outputPanel>
					
		</p:column>
		
	</h:panelGrid>
	

	<h:panelGrid columns="1" styleClass="main-buttons-panel panel" id="mainButtonsPanel">
		<h:column>
			<p:commandButton value="Show" actionListener="#{reportBean.showReport()}" update="tabs" styleClass="main-buttons" disabled="#{reportBean.disableMenu}"/>
			<p:commandButton value="Clear" actionListener="#{reportBean.cancelAction()}" update="tabs" styleClass="main-buttons" disabled="#{reportBean.disableMenu}"/>
			<p:commandButton value="Update" action="#{reportBean.updateData()}" styleClass="main-buttons" disabled="#{reportBean.disableMenu}"/>
		</h:column>
	</h:panelGrid>
	
	
		<p:tabView activeIndex="0" id="tabs" styleClass="tabView">
			<p:tab title="All Issues">
					<p:dataTable var="details" value="#{reportBean.reportIssues}" id="Details" rowIndexVar="rowIndex" >
						<f:facet name="header">Total Time Spent (h:mm)              
    						<p:column datasource="Details" trigger="toggler"/>
                			<p:outputPanel>
                    			<h:outputText value="#{reportBean.allTime}" converter="com.jastt.frontend.beans.worklog.IntToHMConverter"/>
               					<div class="top-export-buttons-panel">
									<h:commandButton  actionListener="#{reportBean.exportIssueList}"  image="/resources/img/pdf32.png" styleClass="export-button" title="Issue report PDF">
										<f:param name="reportFormat" value="pdf"/>
									</h:commandButton>
									<h:commandButton  actionListener="#{reportBean.exportIssueList}"  image="/resources/img/xls32.png" styleClass="export-button" title="Issue report XLS">
										<f:param name="reportFormat" value="xls"/>
									</h:commandButton>
									<h:commandButton actionListener="#{reportBean.exportIssueList}" image="/resources/img/xlsx32.png" styleClass="export-button" title="Issue report XLSX">
										<f:param name="reportFormat" value="xlsx"/>
									</h:commandButton>
<!--                                     <h:outputText value="&#160;&#160;" />
									<h:commandButton  actionListener="# {reportBean.exportByUserList}"  image="/resources/img/pdf32.png" styleClass="export-button" title="By user report PDF">
										<f:param name="reportFormat" value="pdf"/>
									</h:commandButton>
									<h:commandButton  actionListener="# {reportBean.exportByUserList}"  image="/resources/img/xls32.png" styleClass="export-button" title="By user report XLS">
										<f:param name="reportFormat" value="xls"/>
									</h:commandButton>
									<h:commandButton actionListener="# {reportBean.exportByUserList}" image="/resources/img/xlsx32.png" styleClass="export-button" title="By user report XLSX">
										<f:param name="reportFormat" value="xlsx"/>
									</h:commandButton>
 -->
 								</div>
                			</p:outputPanel>            
            			</f:facet>
            			
            			<p:column headerText="№" >
            				<h:outputText  value="#{rowIndex+1}"  />
            			</p:column>
            			<p:column headerText="Created" sortBy="#{details.created}">
            				<h:outputText  value="#{details.created}"  >
            					<f:convertDateTime pattern="dd.MM.yyyy" />
            				 </h:outputText>
            			</p:column>
            			<p:column headerText="Due Date" sortBy="#{details.due}">
            				<h:outputText  value="#{details.due}"  >
            					<f:convertDateTime pattern="dd.MM.yyyy" />
            				 </h:outputText>
            			</p:column>
            			<p:column headerText="Resolved" sortBy="#{details.resolved}">
            				<h:outputText  value="#{details.resolved}"  >
            					<f:convertDateTime pattern="dd.MM.yyyy" />
            				 </h:outputText>
            			</p:column>
						<p:column headerText="Assignee" sortBy="#{details.assignee.name}" width="130">
							<h:outputText  value="#{details.assignee.name}"  />
               			</p:column>
						<p:column headerText="Project"  sortBy="#{details.project.name}" >
							<h:outputText  value="#{details.project.name}"  />
						</p:column>
						<p:column headerText="Type" sortBy="#{details.issueType}">
							<h:outputText  value="#{details.issueType}"  />
						</p:column>
						<p:column headerText="Status" sortBy="#{details.status}" width="90">
						 <h:outputText  value="#{details.status}"  />
						</p:column>
						<p:column headerText="Key" sortBy="#{details.key}"><!-- sortFunction="# {reportBean.sortInNaturalOrder}"-->			
							<h:outputLink value="#{details.url}"  target="blank" styleClass="out-link">#{details.key}</h:outputLink>
						</p:column>
						<p:column headerText="Summary" sortBy="#{details.summary}">
							<h:outputLink value="#{details.url}" target="blank" styleClass="out-link">#{details.summary}</h:outputLink>
						</p:column>
						<p:column headerText="Spent (h:mm)" sortBy="#{details.timeSpent}" width="80">
							<h:outputText  value="#{details.timeSpent}"  converter="com.jastt.frontend.beans.worklog.IntToHMConverter"/>
						</p:column>
						<p:column headerText="Actuality (percent)" sortBy="#{details.actuality}" width="70">
							<h:outputText  value="#{details.actuality}"/>
						</p:column>
						
						<f:facet name="footer">
							<h:outputText value="&#160;" /><br/><h:outputText value="&#160;" />
							
								
							<div class="bottom-export-buttons-panel">
								<h:commandButton  actionListener="#{reportBean.exportIssueList}"  image="/resources/img/pdf32.png" styleClass="export-button" title="Issue report PDF">
									<f:param name="reportFormat" value="pdf"/>
								</h:commandButton>
								<h:commandButton  actionListener="#{reportBean.exportIssueList}"  image="/resources/img/xls32.png" styleClass="export-button" title="Issue report XLS">
									<f:param name="reportFormat" value="xls"/>
								</h:commandButton>
								<h:commandButton actionListener="#{reportBean.exportIssueList}" image="/resources/img/xlsx32.png" styleClass="export-button" title="Issue report XLSX">
									<f:param name="reportFormat" value="xlsx"/>
								</h:commandButton>
<!-- 
                                <h:outputText value="&#160;&#160;" />
								<h:commandButton  actionListener="# {reportBean.exportByUserList}"  image="/resources/img/pdf32.png" styleClass="export-button" title="By user report PDF">
									<f:param name="reportFormat" value="pdf"/>
								</h:commandButton>
								<h:commandButton  actionListener="# {reportBean.exportByUserList}"  image="/resources/img/xls32.png" styleClass="export-button" title="By user report XLS">
									<f:param name="reportFormat" value="xls"/>
								</h:commandButton>
								<h:commandButton actionListener="# {reportBean.exportByUserList}" image="/resources/img/xlsx32.png" styleClass="export-button" title="By user report XLSX">
									<f:param name="reportFormat" value="xlsx"/>
								</h:commandButton>
 -->
 							</div>
						</f:facet>
					</p:dataTable>
			</p:tab>

            <p:tab title="By User">
					<p:dataTable var="grouping" value="#{reportBean.byUserGrouping}" id="byUserList" rowIndexVar="rowIndex" >
						<f:facet name="header">Total Time Spent (h:mm)              
    						<p:column datasource="Details" trigger="toggler"/>
                			<p:outputPanel>
                    			<h:outputText value="#{reportBean.allTime}" converter="com.jastt.frontend.beans.worklog.IntToHMConverter"/>
               					<div class="top-export-buttons-panel">
									<h:commandButton  actionListener="#{reportBean.exportByUserList}"  image="/resources/img/pdf32.png" styleClass="export-button" title="By user report PDF">
										<f:param name="reportFormat" value="pdf"/>
									</h:commandButton>
									<h:commandButton  actionListener="#{reportBean.exportByUserList}"  image="/resources/img/xls32.png" styleClass="export-button" title="By user report XLS">
										<f:param name="reportFormat" value="xls"/>
									</h:commandButton>
									<h:commandButton actionListener="#{reportBean.exportByUserList}" image="/resources/img/xlsx32.png" styleClass="export-button" title="By user report XLSX">
										<f:param name="reportFormat" value="xlsx"/>
									</h:commandButton>
								</div>
                			</p:outputPanel>            
            			</f:facet>
            			
					<p:column>
       					<p:rowToggler />
   					</p:column>
            			<p:column headerText="№" >
            				<h:outputText  value="#{rowIndex+1}"  />
            			</p:column>
            			<p:column headerText="User" sortBy="#{grouping.name}">
            				<h:outputText  value="#{grouping.name}" />
            			</p:column>
					<p:column headerText="Number of Issues" sortBy="#{grouping.issuesCount}">
						<h:outputText  value="#{grouping.issuesCount}"/>
					</p:column>
					<p:column headerText="Spent (h:mm)" sortBy="#{grouping.totalTimeSpent}">
						<h:outputText  value="#{grouping.totalTimeSpent}" converter="com.jastt.frontend.beans.worklog.IntToHMConverter"/>
					</p:column>

						<p:rowExpansion>
							
							<p:dataTable value="#{grouping.issues}" var="details" rowIndexVar="rowIndex">
		            			<p:column headerText="№" >
		            				<h:outputText  value="#{rowIndex+1}"  />
		            			</p:column>
		            			<p:column headerText="Created" sortBy="#{details.created}">
		            				<h:outputText  value="#{details.created}"  >
		            					<f:convertDateTime pattern="dd.MM.yyyy" />
		            				 </h:outputText>
		            			</p:column>
		            			<p:column headerText="Due Date" sortBy="#{details.due}">
		            				<h:outputText  value="#{details.due}"  >
		            					<f:convertDateTime pattern="dd.MM.yyyy" />
		            				 </h:outputText>
		            			</p:column>
		            			<p:column headerText="Resolved" sortBy="#{details.resolved}">
		            				<h:outputText  value="#{details.resolved}"  >
		            					<f:convertDateTime pattern="dd.MM.yyyy" />
		            				 </h:outputText>
		            			</p:column>
								<p:column headerText="Assignee" sortBy="#{details.assignee.name}" width="130">
									<h:outputText  value="#{details.assignee.name}"  />
		               			</p:column>
								<p:column headerText="Project"  sortBy="#{details.project.name}" >
									<h:outputText  value="#{details.project.name}"  />
								</p:column>
								<p:column headerText="Type" sortBy="#{details.issueType}">
									<h:outputText  value="#{details.issueType}"  />
								</p:column>
								<p:column headerText="Status" sortBy="#{details.status}" width="90">
								 <h:outputText  value="#{details.status}"  />
								</p:column>
								<p:column headerText="Key" sortBy="#{details.key}"><!-- sortFunction="# {reportBean.sortInNaturalOrder}"-->			
									<h:outputLink value="#{details.url}"  target="blank" styleClass="out-link">#{details.key}</h:outputLink>
								</p:column>
								<p:column headerText="Summary" sortBy="#{details.summary}">
									<h:outputLink value="#{details.url}" target="blank" styleClass="out-link">#{details.summary}</h:outputLink>
								</p:column>
								<p:column headerText="Spent (h:mm)" sortBy="#{details.timeSpent}" width="80">
									<h:outputText  value="#{details.timeSpent}"  converter="com.jastt.frontend.beans.worklog.IntToHMConverter"/>
								</p:column>
								<p:column headerText="Actuality (percent)" sortBy="#{details.actuality}" width="70">
									<h:outputText  value="#{details.actuality}"/>
								</p:column>
							</p:dataTable>
							
						</p:rowExpansion>
											
						<f:facet name="footer">
							<h:outputText value="&#160;" /><br/><h:outputText value="&#160;" />
							
								
							<div class="bottom-export-buttons-panel">
								<h:commandButton  actionListener="#{reportBean.exportByUserList}"  image="/resources/img/pdf32.png" styleClass="export-button" title="By user report PDF">
									<f:param name="reportFormat" value="pdf"/>
								</h:commandButton>
								<h:commandButton  actionListener="#{reportBean.exportByUserList}"  image="/resources/img/xls32.png" styleClass="export-button" title="By user report XLS">
									<f:param name="reportFormat" value="xls"/>
								</h:commandButton>
								<h:commandButton actionListener="#{reportBean.exportByUserList}" image="/resources/img/xlsx32.png" styleClass="export-button" title="By user report XLSX">
									<f:param name="reportFormat" value="xlsx"/>
								</h:commandButton>
							</div>
						</f:facet>
					</p:dataTable>
			</p:tab>
 
            <p:tab title="By Component">
					<p:dataTable var="grouping" value="#{reportBean.byComponentGrouping}" id="byComponentList" rowIndexVar="rowIndex" >
						<f:facet name="header">Total Time Spent (h:mm)              
    						<p:column datasource="Details" trigger="toggler"/>
                			<p:outputPanel>
                    			<h:outputText value="#{reportBean.allTime}" converter="com.jastt.frontend.beans.worklog.IntToHMConverter"/>
               					<div class="top-export-buttons-panel">
									<h:commandButton  actionListener="#{reportBean.exportByComponentList}"  image="/resources/img/pdf32.png" styleClass="export-button" title="By component report PDF">
										<f:param name="reportFormat" value="pdf"/>
									</h:commandButton>
									<h:commandButton  actionListener="#{reportBean.exportByComponentList}"  image="/resources/img/xls32.png" styleClass="export-button" title="By component report XLS">
										<f:param name="reportFormat" value="xls"/>
									</h:commandButton>
									<h:commandButton actionListener="#{reportBean.exportByComponentList}" image="/resources/img/xlsx32.png" styleClass="export-button" title="By component report XLSX">
										<f:param name="reportFormat" value="xlsx"/>
									</h:commandButton>
								</div>
                			</p:outputPanel>            
            			</f:facet>
            			
					<p:column>
       					<p:rowToggler />
   					</p:column>
            			<p:column headerText="№" >
            				<h:outputText  value="#{rowIndex+1}"  />
            			</p:column>
            			<p:column headerText="Component" sortBy="#{grouping.name}">
            				<h:outputText  value="#{grouping.name}" />
            			</p:column>
					<p:column headerText="Number of Issues" sortBy="#{grouping.issuesCount}">
						<h:outputText  value="#{grouping.issuesCount}"/>
					</p:column>
					<p:column headerText="Spent (h:mm)" sortBy="#{grouping.totalTimeSpent}">
						<h:outputText  value="#{grouping.totalTimeSpent}" converter="com.jastt.frontend.beans.worklog.IntToHMConverter"/>
					</p:column>

						<p:rowExpansion>
							
							<p:dataTable value="#{grouping.issues}" var="details" rowIndexVar="rowIndex">
            			<p:column headerText="№" >
            				<h:outputText  value="#{rowIndex+1}"  />
            			</p:column>
            			<p:column headerText="Created" sortBy="#{details.created}">
            				<h:outputText  value="#{details.created}"  >
            					<f:convertDateTime pattern="dd.MM.yyyy" />
            				 </h:outputText>
            			</p:column>
            			<p:column headerText="Due Date" sortBy="#{details.due}">
            				<h:outputText  value="#{details.due}"  >
            					<f:convertDateTime pattern="dd.MM.yyyy" />
            				 </h:outputText>
            			</p:column>
            			<p:column headerText="Resolved" sortBy="#{details.resolved}">
            				<h:outputText  value="#{details.resolved}"  >
            					<f:convertDateTime pattern="dd.MM.yyyy" />
            				 </h:outputText>
            			</p:column>
						<p:column headerText="Assignee" sortBy="#{details.assignee.name}" width="130">
							<h:outputText  value="#{details.assignee.name}"  />
               			</p:column>
						<p:column headerText="Project"  sortBy="#{details.project.name}" >
							<h:outputText  value="#{details.project.name}"  />
						</p:column>
						<p:column headerText="Component"  sortBy="#{details.component}" >
							<h:outputText  value="#{details.component}"  />
						</p:column>
						<p:column headerText="Type" sortBy="#{details.issueType}">
							<h:outputText  value="#{details.issueType}"  />
						</p:column>
						<p:column headerText="Status" sortBy="#{details.status}" width="90">
						 <h:outputText  value="#{details.status}"  />
						</p:column>
						<p:column headerText="Key" sortBy="#{details.key}"><!-- sortFunction="# {reportBean.sortInNaturalOrder}"-->			
							<h:outputLink value="#{details.url}"  target="blank" styleClass="out-link">#{details.key}</h:outputLink>
						</p:column>
						<p:column headerText="Summary" sortBy="#{details.summary}">
							<h:outputLink value="#{details.url}" target="blank" styleClass="out-link">#{details.summary}</h:outputLink>
						</p:column>
						<p:column headerText="Spent (h:mm)" sortBy="#{details.timeSpent}" width="80">
							<h:outputText  value="#{details.timeSpent}"  converter="com.jastt.frontend.beans.worklog.IntToHMConverter"/>
						</p:column>
						<p:column headerText="Actuality (percent)" sortBy="#{details.actuality}" width="70">
							<h:outputText  value="#{details.actuality}"/>
						</p:column>
							</p:dataTable>
							
						</p:rowExpansion>
						
						<f:facet name="footer">
							<h:outputText value="&#160;" /><br/><h:outputText value="&#160;" />
							
								
							<div class="bottom-export-buttons-panel">
								<h:commandButton  actionListener="#{reportBean.exportByComponentList}"  image="/resources/img/pdf32.png" styleClass="export-button" title="By component report PDF">
									<f:param name="reportFormat" value="pdf"/>
								</h:commandButton>
								<h:commandButton  actionListener="#{reportBean.exportByComponentList}"  image="/resources/img/xls32.png" styleClass="export-button" title="By component report XLS">
									<f:param name="reportFormat" value="xls"/>
								</h:commandButton>
								<h:commandButton actionListener="#{reportBean.exportByComponentList}" image="/resources/img/xlsx32.png" styleClass="export-button" title="By component report XLSX">
									<f:param name="reportFormat" value="xlsx"/>
								</h:commandButton>
							</div>
						</f:facet>
					</p:dataTable>
			</p:tab>

            <p:tab title="By Type">
					<p:dataTable var="grouping" value="#{reportBean.byTypeGrouping}" id="byTypeList" rowIndexVar="rowIndex" >
						<f:facet name="header">Total Time Spent (h:mm)              
    						<p:column datasource="Details" trigger="toggler"/>
                			<p:outputPanel>
                    			<h:outputText value="#{reportBean.allTime}" converter="com.jastt.frontend.beans.worklog.IntToHMConverter"/>
               					<div class="top-export-buttons-panel">
									<h:commandButton  actionListener="#{reportBean.exportByTypeList}"  image="/resources/img/pdf32.png" styleClass="export-button" title="By type report PDF">
										<f:param name="reportFormat" value="pdf"/>
									</h:commandButton>
									<h:commandButton  actionListener="#{reportBean.exportByTypeList}"  image="/resources/img/xls32.png" styleClass="export-button" title="By type report XLS">
										<f:param name="reportFormat" value="xls"/>
									</h:commandButton>
									<h:commandButton actionListener="#{reportBean.exportByTypeList}" image="/resources/img/xlsx32.png" styleClass="export-button" title="By type report XLSX">
										<f:param name="reportFormat" value="xlsx"/>
									</h:commandButton>
								</div>
                			</p:outputPanel>            
            			</f:facet>
            			
					<p:column>
       					<p:rowToggler />
   					</p:column>
            			<p:column headerText="№" >
            				<h:outputText  value="#{rowIndex+1}"  />
            			</p:column>
            			<p:column headerText="Issue Type" sortBy="#{grouping.name}">
            				<h:outputText  value="#{grouping.name}" />
            			</p:column>
					<p:column headerText="Number of Issues" sortBy="#{grouping.issuesCount}">
						<h:outputText  value="#{grouping.issuesCount}"/>
					</p:column>
					<p:column headerText="Spent (h:mm)" sortBy="#{grouping.totalTimeSpent}">
						<h:outputText  value="#{grouping.totalTimeSpent}" converter="com.jastt.frontend.beans.worklog.IntToHMConverter"/>
					</p:column>

						<p:rowExpansion>
							
							<p:dataTable value="#{grouping.issues}" var="details" rowIndexVar="rowIndex">
            			<p:column headerText="№" >
            				<h:outputText  value="#{rowIndex+1}"  />
            			</p:column>
            			<p:column headerText="Created" sortBy="#{details.created}">
            				<h:outputText  value="#{details.created}"  >
            					<f:convertDateTime pattern="dd.MM.yyyy" />
            				 </h:outputText>
            			</p:column>
            			<p:column headerText="Due Date" sortBy="#{details.due}">
            				<h:outputText  value="#{details.due}"  >
            					<f:convertDateTime pattern="dd.MM.yyyy" />
            				 </h:outputText>
            			</p:column>
            			<p:column headerText="Resolved" sortBy="#{details.resolved}">
            				<h:outputText  value="#{details.resolved}"  >
            					<f:convertDateTime pattern="dd.MM.yyyy" />
            				 </h:outputText>
            			</p:column>
						<p:column headerText="Assignee" sortBy="#{details.assignee.name}" width="130">
							<h:outputText  value="#{details.assignee.name}"  />
               			</p:column>
						<p:column headerText="Project"  sortBy="#{details.project.name}" >
							<h:outputText  value="#{details.project.name}"  />
						</p:column>
						<p:column headerText="Type" sortBy="#{details.issueType}">
							<h:outputText  value="#{details.issueType}"  />
						</p:column>
						<p:column headerText="Status" sortBy="#{details.status}" width="90">
						 <h:outputText  value="#{details.status}"  />
						</p:column>
						<p:column headerText="Key" sortBy="#{details.key}"><!-- sortFunction="# {reportBean.sortInNaturalOrder}"-->			
							<h:outputLink value="#{details.url}"  target="blank" styleClass="out-link">#{details.key}</h:outputLink>
						</p:column>
						<p:column headerText="Summary" sortBy="#{details.summary}">
							<h:outputLink value="#{details.url}" target="blank" styleClass="out-link">#{details.summary}</h:outputLink>
						</p:column>
						<p:column headerText="Spent (h:mm)" sortBy="#{details.timeSpent}" width="80">
							<h:outputText  value="#{details.timeSpent}"  converter="com.jastt.frontend.beans.worklog.IntToHMConverter"/>
						</p:column>
						<p:column headerText="Actuality (percent)" sortBy="#{details.actuality}" width="70">
							<h:outputText  value="#{details.actuality}"/>
						</p:column>
							</p:dataTable>
							
						</p:rowExpansion>
						
						<f:facet name="footer">
							<h:outputText value="&#160;" /><br/><h:outputText value="&#160;" />
							
								
							<div class="bottom-export-buttons-panel">
								<h:commandButton  actionListener="#{reportBean.exportByTypeList}"  image="/resources/img/pdf32.png" styleClass="export-button" title="By type report PDF">
									<f:param name="reportFormat" value="pdf"/>
								</h:commandButton>
								<h:commandButton  actionListener="#{reportBean.exportByTypeList}"  image="/resources/img/xls32.png" styleClass="export-button" title="By type report XLS">
									<f:param name="reportFormat" value="xls"/>
								</h:commandButton>
								<h:commandButton actionListener="#{reportBean.exportByTypeList}" image="/resources/img/xlsx32.png" styleClass="export-button" title="By type report XLSX">
									<f:param name="reportFormat" value="xlsx"/>
								</h:commandButton>
							</div>
						</f:facet>
					</p:dataTable>
			</p:tab>
    	</p:tabView>    		
</h:form>
	</ui:define>
</ui:composition>    